﻿<%@ Page Language="C#" Theme="Default" MasterPageFile="~/MasterPages/admin.master" AutoEventWireup="true"  CodeFile="MembersEdit.aspx.cs" Inherits="MembersEdit" Title="Members Edit" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Members - Add/Edit</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
		<data:MultiFormView ID="FormView1" DataKeyNames="MembersId" runat="server" DataSourceID="MembersDataSource">
		
			<EditItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/MembersFields.ascx" />
			</EditItemTemplatePaths>
		
			<InsertItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/MembersFields.ascx" />
			</InsertItemTemplatePaths>
		
			<EmptyDataTemplate>
				<b>Members not found!</b>
			</EmptyDataTemplate>
			
			<FooterTemplate>
				<asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
				<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
				<asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
			</FooterTemplate>

		</data:MultiFormView>
		
		<data:MembersDataSource ID="MembersDataSource" runat="server"
			SelectMethod="GetByMembersId"
		>
			<Parameters>
				<asp:QueryStringParameter Name="MembersId" QueryStringField="MembersId" Type="String" />

			</Parameters>
		</data:MembersDataSource>
		
		<br />

		<data:EntityGridView ID="GridViewOrdersOrder1" runat="server"
			AutoGenerateColumns="False"	
			OnSelectedIndexChanged="GridViewOrdersOrder1_SelectedIndexChanged"			 			 
			DataSourceID="OrdersOrderDataSource1"
			DataKeyNames="OrderId"
			AllowMultiColumnSorting="false"
			DefaultSortColumnName="" 
			DefaultSortDirection="Ascending"	
			ExcelExportFileName="Export_OrdersOrder.xls"  		
			Visible='<%# (FormView1.DefaultMode == FormViewMode.Insert) ? false : true %>'	
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" />
				<data:HyperLinkField HeaderText="Members Id" DataNavigateUrlFormatString="MembersEdit.aspx?MembersId={0}" DataNavigateUrlFields="MembersId" DataContainer="MembersIdSource" DataTextField="MembersName" />
				<asp:BoundField DataField="OrderDate" HeaderText="Order Date" SortExpression="[Order_Date]" />				
				<asp:BoundField DataField="OrderQuantity" HeaderText="Order Quantity" SortExpression="[Order_Quantity]" />				
				<asp:BoundField DataField="OrderTotal" HeaderText="Order Total" SortExpression="[Order_Total]" />				
				<asp:BoundField DataField="ShippingName" HeaderText="Shipping Name" SortExpression="[Shipping_Name]" />				
				<asp:BoundField DataField="ShippingAddress" HeaderText="Shipping Address" SortExpression="[Shipping_Address]" />				
				<asp:BoundField DataField="ShippingTel" HeaderText="Shipping Tel" SortExpression="[Shipping_Tel]" />				
				<asp:BoundField DataField="ShippingCity" HeaderText="Shipping City" SortExpression="[Shipping_City]" />				
				<asp:BoundField DataField="ShippingNotice" HeaderText="Shipping Notice" SortExpression="[Shipping_Notice]" />				
				<asp:BoundField DataField="IsActive" HeaderText="Is Active" SortExpression="[IsActive]" />				
			</Columns>
			<EmptyDataTemplate>
				<b>No Orders Order Found! </b>
				<asp:HyperLink runat="server" ID="hypOrdersOrder" NavigateUrl="~/admin/OrdersOrderEdit.aspx">Add New</asp:HyperLink>
			</EmptyDataTemplate>
		</data:EntityGridView>					
		
		<data:OrdersOrderDataSource ID="OrdersOrderDataSource1" runat="server" SelectMethod="Find"
			EnableDeepLoad="True"
			>
			<DeepLoadProperties Method="IncludeChildren" Recursive="False">
	            <Types>
					<data:OrdersOrderProperty Name="Members"/> 
					<%--<data:OrdersOrderProperty Name="ProductsIdProductsProductCollection_From_OrdersDetails" />--%>
					<%--<data:OrdersOrderProperty Name="OrdersDetailsCollection" />--%>
				</Types>
			</DeepLoadProperties>
			
		    <Parameters>
				<data:SqlParameter Name="Parameters">
					<Filters>
						<data:OrdersOrderFilter  Column="MembersId" QueryStringField="MembersId" /> 
					</Filters>
				</data:SqlParameter>
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" /> 
		    </Parameters>
		</data:OrdersOrderDataSource>		
		
		<br />
		

</asp:Content>

